//
// Created by francklinson on 2021/11/18 AT 10:05.
// May Saint Diana bless you!
//

#include <iostream>
#include <vector>


using namespace std;

class Solution {
public:
    int minOperations(string s) {
        // 其实已经知道最终的两种可能结果  把当前字符串和它们对比一下就可以了
        vector<char> OneZero{'0', '1'};
        int n = (int) s.size();
        int first = 0, second = 0;
        for (int i = 0; i < n; ++i) {
            if (s[i] != OneZero[i % 2])
                ++first;
            else
                ++second;
        }
        return min(first, second);
    }
};

int main() {
    Solution solution;
    cout << solution.minOperations("101010111000") << endl;
    return 0;
}

